package com.qf.controller;

import com.qf.entity.User;
import com.qf.service.LoveShowService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

/**
 * @author chen
 * @version 1.0
 * @date 2019/10/24 13:02
 */
@Controller
public class LoveShowController {
    @Resource
    private LoveShowService showService;

    @RequestMapping("/community/addShow")
    @ResponseBody
    public Map addShow(String showText, @RequestParam("multipartFile") MultipartFile multipartFile, HttpSession session, HttpServletRequest request){
        User user =(User) session.getAttribute("user");
        showService.addShow(showText,multipartFile,1,request);

        Map map = new HashMap();
        map.put("code", 1);
        map.put("msg", "success");
        return map;
    }






}
